package com.jblog.core.service.site.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jblog.core.dao.site.SiteDao;
import com.jblog.core.model.site.Site;
import com.jblog.core.service.site.SiteService;

@Service
public class SiteServiceImpl implements SiteService {

    @Autowired private SiteDao siteDao;
    
    @Override
    public Site find() {
        return siteDao.get();
    }

    @Override
    public void saveOrUpdate(Site e) {
//        if (null == e.getId()) {
//            siteDao.save(e);
//        } else {
//            siteDao.update(e);
//        }
        //no need save, will init in database
        siteDao.update(e);
    }

}
